All Functions of Week 8

print

{base}

Print object to the console

ifelse

{base}

Return a or b depending on the value of test

lm

{base}

Fit a linear model

attach

{base}

Attach Set of R Objects to Search Path

mutate

{dplyr}

Modify/create a column in a data frame

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

class

{base}

Retrieve class of an R object

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

ylab

{GGPLOT2}

Label the y axis (ggplot)

filter

{dplyr}

Filter out rows of a data frame according to logical vector

library

{base}

Load an R package

summary

{base}

Obtain summary statistics or detailed regression output

coord_flip

{GGPLOT2}

Flip the x and y axes of a graph

data.frame

{base}

Create a data.frame from vectors

geom_hline

{GGPLOT2}

Add a horizontal line in GGPLOT2

head

{utils}

Show first 5 rows of a data frame

as.factor

{base}

Coerce a vector to factor

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

rm

{base}

Remove objects

quantile

{stats}

Obtain empirical quantiles of a vector

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

geom_histogram

{GGPLOT2}

Generates a histogram

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

cor

{stats}

Calculate Correlation Matrix

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

geom_point

{GGPLOT2}

Generates a scatter plot

confint

{stats}

Calculate confidence Intervals for Model Parameters

order

{base}

Get indexes that will sort a vector

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

sum

{base}

Get sum of numeric values or a vector

stargazer

{stargazer}

Create a regression output table

mean

{base}

Get mean of a vector

rbind

{base}

Combine R objects by rows

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

str

{utils}

Get the structure of an R object

scale_colour_manual

{GGPLOT2}

Create your own discrete scale

dim

{base}

Get dimensions of a data frame

which

{base}

return indexes of TRUE entries of a logical vector

labs

{GGPLOT2}

Customise labels in GGPLOT2

names

{base}

Retrieve names of a list/vector

select

{dplyr}

Select columns from a tibble/data frame

element_text

{GGPLOT2}

Customise text in GGPLOT2

reorder

{stats}

Reorder Levels of Factor based on the values of a second variable, usually numeric.

geom_vline

{GGPLOT2}

Draws a vertical line

colnames

{base}

Retrieve column names of a data frame

c

{base}

Combine values/vectors into a vector

with

{base}

evaluate expression in the context of a data frame

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

predict

{stats}

Predict Probability

setwd

{base}

Set Working Directory

xlab

{GGPLOT2}

Label the x axis (ggplot)

theme

{GGPLOT2}

Set theme for GGPLOT2

ggplot

{GGPLOT2}

Create a ggplot graph

The end!